import { CSSProperties, PropsWithChildren } from "react";

export type TIconName =
  | '"icon-shanchu-delete-line'
  | "icon-fuzhi-copy-line"
  | "icon-a-paixu2"
  | "icon-paixu1"
  | "icon-lujing"
  | "icon-bookmark--outline"
  | "icon-a-lianji2331x"
  | "icon-a-lujing1x"
  | "icon-a-lujing2x"
  | "icon-a-jianqudingceng180biankuang1x"
  | "icon-a-jianqudingceng1031x"
  | "icon-a-jianqudingceng1721x"
  | "icon-a-zhixian1x"
  | "icon-yuanwengaixie-aiEdit-line"
  | "icon-tishi-info-line"
  | "icon-shenchashibai-reviewFailed-line"
  | "icon-a-dingwei-target-line1x"
  | "icon-a-down-to-bottom-line1x"
  | "icon-a-paixu1x"
  | "icon-a-down-to-bottom-line1x-copy"
  | "icon-a-paixu1x-copy"
  | "icon-a-zanting-pause-line1x"
  | "icon-pizhu"
  | "icon-zhongfengxian-xuanzhong"
  | "icon-zhongfengxian-weixuanzhong"
  | "icon-shaixuan-xuanzhong"
  | "icon-gaofengxian-xuanzhong"
  | "icon-shaixuan-weixuanzhong"
  | "icon-gaofengxian-weixuanzhong"
  | "icon-difengxian-xuanzhong"
  | "icon-difengxian-weixuanzhong"
  | "icon-yuanwenyuedu-weixuanzhong"
  | "icon-yuanwenyuedu-xuanzhong"
  | "icon-fenduanyuedu-weixuanzhong"
  | "icon-fenduanyuedu-xuanzhong"
  | "icon-guanliananjian"
  | "icon-anliyanpan"
  | "icon-faguijiansuo"
  | "icon-leianjiansuo"
  | "icon-a-lianji114"
  | "icon-a-cailiaowendang"
  | "icon-wenjianjia"
  | "icon-gengduo"
  | "icon-tianjia"
  | "icon-cebianlan"
  | "icon-shanchu"
  | "icon-fanyeqi-xia"
  | "icon-fanyeqi-shang"
  | "icon-zoom-out"
  | "icon-suoxiao"
  | "icon-zhilingjiantou"
  | "icon-tuijiananli1"
  | "icon-tuijianfagui2"
  | "icon-shengchengzhaiyao"
  | "icon-a-conversation12"
  | "icon-xiazai_default"
  | "icon-a-conversation11"
  | "icon-charubiji1"
  | "icon-tongyiwanxiang_default"
  | "icon-a-conversation1"
  | "icon-jiazai_default"
  | "icon-charubiji"
  | "icon-tuichudenglu"
  | "icon-xinjianduihua"
  | "icon-yizhiding"
  | "icon-yishoucang"
  | "icon-sousuo"
  | "icon-zhongxinshengcheng_default"
  | "icon-zan_default"
  | "icon-tishi"
  | "icon-shouzhe"
  | "icon-wenshushengcheng1"
  | "icon-zhongzhiduihua"
  | "icon-gongnengfankui"
  | "icon-wangluoyichang"
  | "icon-tuijiananli"
  | "icon-caozuoshouce"
  | "icon-fuzhi_default"
  | "icon-fasong_default"
  | "icon-quxiao_default"
  | "icon-bianji_default"
  | "icon-zhilingji"
  | "icon-jinrujiantou_default"
  | "icon-tingzhihuida_default1"
  | "icon-shuaxin_default"
  | "icon-zhuandao_default"
  | "icon-xiugaichenggong"
  | "icon-shoucang_default"
  | "icon-chajian_default"
  | "icon-cai_default"
  | "icon-tuijianfagui1"
  | "icon-shanchu_default"
  | "icon-queren_default"
  | "icon-zhiding_default"
  | "icon-fanhui_default"
  | "icon-yijianfankui"
  | "icon-tingzhihuida_default"
  | "icon-wenshushengcheng"
  | "icon-tuijianfagui"
  | "tongyi-immersiveMode-line"
  | "tongyi-right-fill"
  | "tongyi-left-fill"
  | "tongyi-refresh-line"
  | "tongyi-finance-fill"
  | "tongyi-sport-fill"
  | "tongyi-messageNotice-line"
  | "tongyi-document-line"
  | "tongyi-videoCall-line"
  | "tongyi-stop-fill"
  | "tongyi-task-line"
  | "tongyi-info-fill"
  | "tongyi-subscription-line"
  | "tongyi-setting-line"
  | "tongyi-favorite-line"
  | "tongyi-voiceError-line"
  | "tongyi-voiceError-fill"
  | "tongyi-aiPronunciation-line"
  | "tongyi-noWiFi-line"
  | "tongyi-subtitleOff-line"
  | "tongyi-subtitleOn-line"
  | "tongyi-doubleStar-line"
  | "tongyi-power-line"
  | "tongyi-translationOff-line"
  | "tongyi-pause-fill"
  | "tongyi-lock-fill"
  | "tongyi-replace-line"
  | "tongyi-rotateScreen-line"
  | "tongyi-doubleStar-fill"
  | "tongyi-gift-fill"
  | "tongyi-message-line"
  | "tongyi-newChat-line"
  | "tongyi-rocket-fill"
  | "tongyi-record-fill"
  | "tongyi-flag-fill"
  | "tongyi-complaint-line"
  | "tongyi-addPicture-line"
  | "tongyi-deletePicture-line"
  | "tongyi-picture-line"
  | "tongyi-download-line"
  | "tongyi-searchMore-line"
  | "tongyi-upperrightArrow-line"
  | "tongyi-down-fill"
  | "tongyi-up-fill"
  | "tongyi-clear-line"
  | "tongyi-tea-fill"
  | "tongyi-phone-line"
  | "tongyi-agreement-line"
  | "tongyi-date-line"
  | "tongyi-selectText-line"
  | "tongyi-search-line"
  | "tongyi-timestamp-line"
  | "tongyi-searchRecord-line"
  | "tongyi-link-line"
  | "tongyi-copy-line"
  | "tongyi-todoList-line"
  | "tongyi-send-line"
  | "tongyi-disableCircle-line"
  | "tongyi-menu-line"
  | "tongyi-more-line"
  | "tongyi-privacy-line"
  | "tongyi-hot-line"
  | "tongyi-hot-fill"
  | "tongyi-edit-fill"
  | "tongyi-edit-line"
  | "tongyi-delete01-line"
  | "tongyi-warningCircle-line"
  | "tongyi-warningCircle-fill"
  | "tongyi-bottom-line"
  | "tongyi-top-line"
  | "tongyi-false-line"
  | "tongyi-true-line"
  | "tongyi-play-fill"
  | "tongyi-thumbsUp-line"
  | "tongyi-thumbsUp-fill"
  | "tongyi-thumbsDown-line"
  | "tongyi-thumbsDown-fill"
  | "tongyi-jia-plus-line"
  | "tongyi-jian-minus-line"
  | "tongyi-stopCircle-line"
  | "tongyi-alert-line"
  | "tongyi-heart-line"
  | "tongyi-heart-fill"
  | "tongyi-leftArrow-line"
  | "tongyi-upArrow-line"
  | "tongyi-downArrow-line"
  | "tongyi-rightArrow-line"
  | "tongyi-delete02-line"
  | "tongyi-delete02-fill"
  | "tongyi-addCircle-fill"
  | "tongyi-addCircle-line"
  | "tongyi-errorCircle-fill"
  | "tongyi-checkCircle-fill"
  | "tongyi-checkCircle-line"
  | "tongyi-errorCircle-line"
  | "tongyi-info-line"
  | "tongyi-uploadFile-line"
  | "tongyi-quickFill-line"
  | "tongyi-target-line"
  | "tongyi-zhinengshengcheng-aiGenerate-line"
  | "tongyi-unlock-line"
  | "tongyi-lock-line"
  | "tongyi-shrink-line"
  | "tongyi-enlarge-line"
  | "tongyi-switch-line"
  | "tongyi-starOff-line"
  | "tongyi-starOff-fill"
  | "tongyi-star-line"
  | "tongyi-star-fill"
  | "tongyi-keyboard-line"
  | "tongyi-micOn-line"
  | "tongyi-micOff-line"
  | "tongyi-mic-line"
  | "tongyi-volume-line"
  | "tongyi-addVolume-line"
  | "tongyi-reduceVolume-line"
  | "tongyi-lowVolume-line"
  | "tongyi-mute-line"
  | "tongyi-escape-line"
  | "tongyi-share-line"
  | "tongyi-right-line"
  | "tongyi-left-line"
  | "tongyi-down-line"
  | "tongyi-up-line"
  | "tongyi-private-line"
  | "tongyi-userGroup-fill"
  | "tongyi-userGroup-line"
  | "tongyi-public-line"
  | "tongyi-partiallyVisible-line"
  | "tongyi-disclosureAgreement-line"
  | "tongyi-user-line"
  | "extend-sort-line"
  | "extend-amplify-line"
  | "extend-inspirationPoint-fill"
  | "extend-chat-line"
  | "extend-statistics-line"
  | "extend-largeModel-line"
  | "extend-ifNode-line"
  | "extend-mergePicture-line"
  | "extend-unfoldPicture-line"
  | "extend-effiency-line"
  | "extend-projectNo-line"
  | "extend-textImage-line"
  | "extend-textIcon-line"
  | "extend-replay-line"
  | "extend-textBox-line"
  | "extend-interpret-line"
  | "extend-spellBook-line"
  | "extend-addSubLevel-line"
  | "extend-aiPPT-line"
  | "extend-increaseUp-line"
  | "extend-increaseDown-line"
  | "extend-goOn-line"
  | "extend-starCard-line"
  | "extend-subscripted-line"
  | "extend-kick-line"
  | "extend-weightLifting-line"
  | "extend-archery-line"
  | "extend-skateboarding-line"
  | "extend-qihang-ride-line"
  | "extend-memory-line"
  | "extend-run-line"
  | "extend-digitalAsset-line"
  | "extend-singleStar-fill"
  | "extend-singleStar-line"
  | "extend-redo-line"
  | "extend-undo-line"
  | "extend-rights-line"
  | "extend-attachment-line"
  | "extend-read-line"
  | "extend-cite-fill"
  | "extend-upload-line"
  | "extend-agentTab-fill"
  | "extend-searchTab-fill"
  | "extend-chatTab-fill"
  | "extend-efficiencyTab-fill"
  | "extend-catalog-line"
  | "extend-oneclickCollapse-line"
  | "extend-oneclickExpansion-line"
  | "extend-myRecord-line"
  | "extend-toolbox-line"
  | "extend-aiSwitch-line"
  | "extend-code01-fill"
  | "extend-code01-line"
  | "extend-loading-line"
  | "extend-at-line"
  | "extend-browse-line"
  | "extend-save-line"
  | "extend-hangup-line"
  | "extend-dial-line"
  | "extend-hide-line"
  | "extend-visable-line"
  | "extend-mark-line"
  | "extend-move-line"
  | "extend-play-line"
  | "extend-video-fill"
  | "extend-video-line"
  | "extend-delete-fill"
  | "extend-pause-line"
  | "extend-cancelTop-line"
  | "extend-computer-line"
  | "extend-internet-line"
  | "extend-camera-line"
  | "extend-filter-line"
  | "extend-filter-fill"
  | "extend-feedback-line"
  | "extend-fileSwitch-line"
  | "extend-list-line"
  | "extend-playCircle-fill"
  | "extend-pauseCircle-fill"
  | "extend-newCopy-line"
  | "extend-picture-fill"
  | "extend-lastSentence-line"
  | "extend-nextSentence-line"
  | "extend-voiceChat02-line"
  | "extend-other-fill"
  | "extend-other-line"
  | "extend-voiceChat01-line"
  | "extend-defaultSize-line"
  | "extend-update-fill"
  | "extend-multipleChoice-line"
  | "extend-permission-line"
  | "extend-modify-line"
  | "extend-extractMark-line"
  | "extend-huidaobofangweizhi-targetPlayer-line"
  | "extend-fedback-line"
  | "extend-smallWindow-line"
  | "extend-agreement02-line"
  | "extend-paper-line"
  | "extend-pageSearch-line"
  | "extend-seal-line"
  | "extend-book-line"
  | "extend-batchMove-line"
  | "extend-extract-line"
  | "extend-searchMore-fill"
  | "extend-tongyi-line"
  | "extend-tongyiShape-line"
  | "extend-processFailed-line"
  | "extend-process-line"
  | "extend-code02-line"
  | "extend-aiEdit-line"
  | "extend-aiEdit-fill"
  | "extend-luckyBag-line"
  | "extend-treasure-line"
  | "extend-privacyAgreement-line"
  | "extend-command-line"
  | "extend-dingtalk-fill"
  | "extend-problem-line"
  | "extend-appeal-line"
  | "extend-QQkongjian-qzone-fill"
  | "extend-pengyouquan-moments-fill"
  | "extend-QQ-qq-fill"
  | "extend-wechat-fill"
  | "extend-weibo-fill"
  | "extend-translate-fill"
  | "extend-time-line"
  | "extend-translate-line"
  | "extend-scheduleCheck-line"
  | "extend-properNoun-line"
  | "extend-downloadPicture-line"
  | "extend-searchUser-line"
  | "extend-addUser-line"
  | "extend-removeUser-line"
  | "extend-timbre-line"
  | "extend-digitalWork-line"
  | "extend-userChecked-line"
  | "extend-userDeleted-line"
  | "extend-agent-line"
  | "extend-searchUser-fill"
  | "extend-smartTool-line"
  | "icon-dagang"
  | "icon-fanhui1"
  | "icon-shiyongshili"
  | "icon-baibaoxiang1"
  | "icon-beijingtushengcheng"
  | "icon-shangchuantuxiang1"
  | "icon-xiangyou"
  | "icon-xiangzuo"
  | "icon-fasong-ruo"
  | "icon-shijian"
  | "icon-bofang"
  | "icon-yinpin"
  | "icon-radio2"
  | "icon-zanting"
  | "icon-lingganzhi_anniu"
  | "icon-suibianliaoliao1"
  | "icon-yinse"
  | "icon-a-radio1"
  | "icon-kuaijiehuanchu"
  | "icon-xiangsituxiangshengcheng"
  | "icon-wenbenshengchengtuxiang1"
  | "icon-tuxiangfenggeqianyi1"
  | "icon-fangda2"
  | "icon-fuwei1"
  | "icon-qiehuan"
  | "icon-huiche"
  | "icon-guanlihuazuo1"
  | "icon-genghuan1"
  | "icon-shang"
  | "icon-quxiao1"
  | "icon-tuijian3"
  | "icon-suoxiao1"
  | "icon-wenbenshengchengtuxiang"
  | "icon-shangchuantuxiang"
  | "icon-weiguituxiang"
  | "icon-shanchu2"
  | "icon-tushengtu"
  | "icon-xia"
  | "icon-tuxiangfenggeqianyi"
  | "icon-tuichu2"
  | "icon-xiala1"
  | "icon-zaiciyinyong1"
  | "icon-zaicishengcheng"
  | "icon-xinxi1"
  | "icon-arrow-left1"
  | "icon-task"
  | "icon-bianji1"
  | "icon-yuanjiao2"
  | "icon-cuowuguanbi"
  | "icon-guanlihuazuo"
  | "icon-zhongxinshengcheng2"
  | "icon-tupianzoudiu"
  | "icon-next"
  | "icon-genghuan"
  | "icon-tuijian2"
  | "icon-butuijian2"
  | "icon-fangda1"
  | "icon-fuwei"
  | "icon-shanchu1"
  | "icon-shouqi"
  | "icon-xiazai"
  | "icon-zaiciyinyong"
  | "icon-chicun"
  | "icon-fengge"
  | "icon-yidong"
  | "icon-shijianchuo"
  | "icon-suoxiao"
  | "icon-sousuozengqiang-guanbi"
  | "icon-sousuozengqiang-dakai"
  | "icon-loading"
  | "icon-touxiang-gou"
  | "icon-touxiang-mao"
  | "icon-touxiang-ren"
  | "icon-butuijian1"
  | "icon-bianji"
  | "icon-duibi"
  | "icon-fankui1"
  | "icon-fasong"
  | "icon-jieshu1"
  | "icon-lishi"
  | "icon-quxiao"
  | "icon-fuzhi2"
  | "icon-queding"
  | "icon-tuijian1"
  | "icon-shanchu"
  | "icon-shangchuan"
  | "icon-zhongshi"
  | "icon-xinzeng"
  | "icon-tuichu1"
  | "icon-fanhui"
  | "icon-paizhao"
  | "icon-wenjian"
  | "icon-tuku"
  | "icon-pdf"
  | "icon-quanbu"
  | "icon-remen"
  | "icon-yule"
  | "icon-xiaoshuai"
  | "icon-shenghuo"
  | "icon-upload_file"
  | "icon-duihua"
  | "icon-yulanicon"
  | "icon-check"
  | "icon-close"
  | "icon-delete"
  | "icon-edit"
  | "icon-pause"
  | "icon-redo"
  | "icon-copy1"
  | "icon-aplus"
  | "icon-back"
  | "icon-feedback"
  | "icon-baibaoxiang"
  | "icon-category"
  | "icon-arrow1"
  | "icon-arrow-left"
  | "icon-a-suibianliaoliaobeifen3"
  | "icon-xiaozhuli"
  | "icon-suibianliaoliao"
  | "icon-yonghu"
  | "icon-butuijian"
  | "icon-jieshu"
  | "icon-tuijian"
  | "icon-fankui"
  | "icon-fuzhi1"
  | "icon-xiala"
  | "icon-jinru"
  | "icon-jixu1"
  | "icon-warning"
  | "icon-success"
  | "icon-error"
  | "icon-like"
  | "icon-arrow"
  | "icon-yuanjiao"
  | "icon-miaobian"
  | "icon-caidan"
  | "icon-yuanjiao1"
  | "icon-new"
  | "icon-fuzhi"
  | "icon-fangda"
  | "icon-guanbi"
  | "icon-duihao"
  | "icon-yuanjiao3"
  | "icon-yuanjiao4"
  | "icon-yuanjiao5"
  | "icon-yuanjiao6"
  | "icon-tuichu"
  | "icon-sousuo"
  | "icon-zhongxinshengcheng"
  | "icon-enter"
  | "icon-yuanjiao8"
  | "icon-yuanjiao9"
  | "icon-jixu"
  | "icon-touxiang"
  | "icon-xinxi"
  | "icon-yuanjiao10"
  | 'icon-yuanjiao11"';

interface ISvgIconProps {
  style?: CSSProperties;
  className?: string;
  size?: string | number;
  name: TIconName | string;
  color?: string;
  onClick?: (e?: any) => void;
}
export function SvgIcon(props: PropsWithChildren<ISvgIconProps>) {
  const { size = 14, name, color, className, onClick, style } = props;

  return (
    <span
      role="img"
      onClick={(e) => {
        if (onClick) {
          e.stopPropagation();
          onClick(e);
        }
      }}
      className={className}
      style={{
        color: color,
        fontSize: size,
        ...style,
      }}
    >
      <svg
        width="1em"
        height="1em"
        fill="currentColor"
        aria-hidden="true"
        focusable="false"
      >
        <use xlinkHref={"#" + name}></use>
      </svg>
    </span>
  );
}
